#include "stdafx.h"
#include "UIRect.h"

CUIRect::CUIRect(): m_iLeft( 0 ), m_iTop( 0 ), m_iWidth( 0 ), m_iHeight( 0 )
{

}

CUIRect::CUIRect( int iLeft, int iTop, int iWidth, int iHeight ): m_iLeft( iLeft ), m_iTop( iTop ), m_iWidth( iWidth ), m_iHeight( iHeight )
{

}

CUIRect::~CUIRect()
{

}

CUIRect::CUIRect( const CUIRect& uiRect )
{
    SetPosition( uiRect.GetLeft(), uiRect.GetTop() );
    SetSize( uiRect.GetWidth(), uiRect.GetHeight() );
}

void CUIRect::SetPosition( int iLeft, int iTop )
{
    m_iLeft = iLeft;
    m_iTop = iTop;
}

void CUIRect::SetSize( int iWidth, int iHeight )
{
    m_iWidth = iWidth;
    m_iHeight = iHeight;
}

int CUIRect::GetWidth()const
{
    return m_iWidth;
}

int CUIRect::GetHeight()const
{
    return m_iHeight;
}

int CUIRect::GetLeft()const
{
    return m_iLeft;
}

int CUIRect::GetTop()const
{
    return m_iTop;
}

int CUIRect::GetRight()const
{
    return m_iLeft + m_iWidth;
}

int CUIRect::GetBottom()const
{
    return m_iTop + m_iHeight;
}

POINT CUIRect::GetPosition()const
{
    POINT pos;
    pos.x = m_iLeft;
    pos.y = m_iTop;
    return pos;
}

SIZE CUIRect::GetSize()const
{
    SIZE size;
    size.cx = m_iWidth;
    size.cy = m_iHeight;
    return size;
}

